import 'package:dio/dio.dart';
import 'package:lyps_music/request/index.dart';

class Api {

  /// 获取音乐列表
  static Future<Response<dynamic>> getMusicList () async => await MyRequest.dio.get("/home/musiclist");
  /// 获取音乐详情
  static Future<Response<dynamic>> getMusicInfo (String id) async => await MyRequest.dio.get("/home/musicinfo",queryParameters: {'id':id});
  /// 获取音乐歌词
  static Future<Response<dynamic>> getMusicText (String path) async => await MyRequest.dio.get(path,options: Options(responseType: ResponseType.bytes));
  
  /// 获取自动补全列表
  static Future<Response<dynamic>> getWordList (String word) async => await MyRequest.dio.get("/home/searchmusic",queryParameters: {'q':word});
  /// 搜索歌曲
  static Future<Response<dynamic>> searchList (String word) async => await MyRequest.dio.get("/home/musiclist",queryParameters: {'q':word});
  
}